<?
$catid= $this->input->post('catid');
$field= $this->input->post('field');


$category=ORM::factory('category', $catid);

if($category->media->count()==0){
	echo"No images in this Container";
}

foreach($category->media as $media){
	$url=$media->get_icon(80,80);
	echo '<div class="media_elm">';
	echo html::file_anchor($media->url,html::image($url),array('target'=>'media'));	
	echo '<div class="elmhead" >';
	echo form::checkbox($field.'[]',$media->id);
	echo '</div>';
	if($media->type!="image"){
		echo '<div style="margin:20px 0 0 0;">';
		echo $media->origfilename;
		echo '</div>';
	}
	
	echo '</div>';
}

echo '<div class="clear"></div>';

?>



